package com.hclc.api;

import java.util.function.Supplier;

/**
 * @ClassName PStatisticsRedisCache
 * @Author: yurj
 * @Mail：1638234804@qq.com
 * @Date: Create in 9:44 2020/9/6
 * @version: 1.0
 */
public interface PStatisticsRedisCacheService {

    /**
     * 获取缓存统计数据(默认过期时间)
     *
     * @param refresh
     * @param redisKey
     * @param supplier
     * @param dtoClazz
     * @return T
     * @author yurj
     * @mail 1638234804@qq.com
     * @version 1.0
     * @date 2020/9/6 11:18
     */
    <T> T getStatisticsData(boolean refresh, String redisKey, Supplier supplier, Class<T> dtoClazz);

    /**
     * 获取缓存统计数据(自定义过期时间)
     *
     * @param refresh
     * @param redisKey
     * @param expiration
     * @param supplier
     * @param dtoClazz
     * @return T
     * @author yurj
     * @mail 1638234804@qq.com
     * @version 1.0
     * @date 2020/9/6 11:19
     */
    <T> T getStatisticsData(boolean refresh, String redisKey, long expiration, Supplier supplier, Class<T> dtoClazz);
}
